Ext.define('NIM.view.AssetDataMaster.AssetPLNForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.AssetPLNForm',
    id: 'assetplnform',
    method: 'POST',
    url: './Services/Asset/AssetPLN/Update',
    listeners: {
        afterrender: function () {
            setDataPln(category, site_id);
        }
    },
    items: [
        {
            xtype: 'hiddenfield',
            cls: 'black',
            id: 'assetdetailidpln',
            name: 'ASSET_DETAIL_ID',
            margin: '10 10 5 25',
            labelWidth: 100 / 1366 * screen.width,
            width: 300 / 1366 * screen.width,
            fieldLabel: 'Asset ID',
            msgTarget: 'title',
            allowBlank: true,
            validateBlank: false

        },
        {
            xtype: 'textfield',
            cls: 'black',
            id: 'siteidpln',
            name: 'SITE_ID',
            margin: '10 10 5 25',
            labelWidth: 100 / 1366 * screen.width,
            width: 300 / 1366 * screen.width,
            fieldLabel: 'Site ID',
            msgTarget: 'title',
            allowBlank: true,
            validateBlank: false

        },
        {
            xtype: 'textfield',
            cls: 'black',
            id: 'assetcategorypln',
            name: 'ASSET_CATEGORY',
            margin: '10 10 5 25',
            labelWidth: 100 / 1366 * screen.width,
            width: 650 / 1366 * screen.width,
            fieldLabel: 'Asset Category',
            msgTarget: 'title',
            allowBlank: true,
            validateBlank: false

        },
        {
            xtype: 'textfield',
            cls: 'black',
            id: 'assetcategorydescpln',
            margin: '10 10 5 25',
            labelWidth: 100 / 1366 * screen.width,
            width: 650 / 1366 * screen.width,
            fieldLabel: 'Description',
            msgTarget: 'title',
            allowBlank: true,
            validateBlank: false

        },
        {
            xtype: 'fieldset',
            columnWidth: 0.5,
            title: 'Inventory Information',
            width: 690,
            heigth: 180,
            margin: '15 10 5 10',
            items: [{
                    xtype: 'panel',
                    border: false,
                    layout: {
                        type: 'table',
                        columns: 2
                    },
                    items: [{
                            xtype: 'panel',
                            width: 345,
                            height: 180,
                            border: false,
                            margin: '0 10 0 0',
                            items: [
                                {
                                    xtype: 'textfield',
                                    cls: 'black',
                                    id: 'skupln',
                                    name: 'SKU_NUMBER',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 250 / 1366 * screen.width,
                                    fieldLabel: 'SKU',
                                    msgTarget: 'title',
                                    allowBlank: true,
                                    validateBlank: false
                                },
                                {
                                    xtype: 'textfield',
                                    cls: 'black',
                                    id: 'serialnumberpln',
                                    name: 'SERIAL_NUMBER',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 300 / 1366 * screen.width,
                                    fieldLabel: 'Serial No',
                                    msgTarget: 'title',
                                    allowBlank: true,
                                    validateBlank: false
                                },
                                {
                                    xtype: 'textfield',
                                    cls: 'black',
                                    id: 'ponumberpln',
                                    name: 'PO_NUMBER',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 250 / 1366 * screen.width,
                                    fieldLabel: 'Post No',
                                    msgTarget: 'title',
                                    allowBlank: true,
                                    validateBlank: false
                                },
                                {
                                    xtype: 'textfield',
                                    cls: 'black',
                                    id: 'bastpln',
                                    name: 'BAST',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 250 / 1366 * screen.width,
                                    fieldLabel: 'BAST',
                                    msgTarget: 'title',
                                    allowBlank: true,
                                    validateBlank: false
                                },
                                {
                                    xtype: 'combobox',
                                    cls: 'black',
                                    id: 'statusactivepln',
                                    name: 'STATUS',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 300 / 1366 * screen.width,
                                    fieldLabel: 'Status',
                                    emptyText: 'Status',
                                    store: [['active', 'ACTIVE'], ['inactive', 'INACTIVE']],
                                    msgTarget: 'title',
                                    allowBlank: true
                                }
                            ]
                        },
                        {
                            xtype: 'panel',
                            width: 345,
                            border: false,
                            height: 180,
                            items: [{
                                    xtype: 'combobox',
                                    cls: 'black',
                                    id: 'assettelkomselpln',
                                    name: 'ASSET_FLAG',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 300 / 1366 * screen.width,
                                    fieldLabel: 'Asset Telkomsel',
                                    emptyText: 'Asset Telkomsel',
                                    store: [['yes', 'Yes'], ['no', 'No']],
                                    msgTarget: 'title',
                                    allowBlank: true
                                },
                                {
                                    xtype: 'textfield',
                                    cls: 'black',
                                    id: 'partnopln',
                                    name: 'PART_NUMBER',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 300 / 1366 * screen.width,
                                    fieldLabel: 'Part No',
                                    msgTarget: 'title',
                                    allowBlank: true,
                                    validateBlank: false
                                },
                                {
                                    xtype: 'panel',
                                    border: false,
                                    height: 20

                                },
                                {
                                    xtype: 'textfield',
                                    cls: 'black',
                                    id: 'porcvnumberpln',
                                    name: 'RCV_NUMBER',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 250 / 1366 * screen.width,
                                    fieldLabel: 'Po Rcv No',
                                    msgTarget: 'title',
                                    allowBlank: true,
                                    validateBlank: false
                                },
                                {
                                    xtype: 'textfield',
                                    cls: 'black',
                                    id: 'referencepln',
                                    name: 'REFERENCE',
                                    margin: '10 10 5 5',
                                    labelWidth: 100 / 1366 * screen.width,
                                    width: 250 / 1366 * screen.width,
                                    fieldLabel: 'Reference',
                                    msgTarget: 'title',
                                    allowBlank: true,
                                    validateBlank: false
                                }]

                        }]


                }]
        },
        {
            xtype: 'fieldset',
            columnWidth: 0.5,
            title: 'PLN Information',
            width: 690,
            height: 70,
            layout: 'hbox',
            margin: '15 10 5 10',
            items: [{
                    xtype: 'textfield',
                    cls: 'black',
                    id: 'plnidpelanggan',
                    name: 'PLN_ID_METER',
                    margin: '10 10 5 5',
                    labelWidth: 100 / 1366 * screen.width,
                    width: 300 / 1366 * screen.width,
                    fieldLabel: 'PLN ID Pelanggan',
                    msgTarget: 'title',
                    allowBlank: true,
                    validateBlank: false
                },
                {
                    xtype: 'textfield',
                    cls: 'black',
                    id: 'satuandayapln',
                    name: 'PLN_DAYA_SATUAN',
                    margin: '10 10 5 45',
                    labelWidth: 100 / 1366 * screen.width,
                    width: 150 / 1366 * screen.width,
                    fieldLabel: 'Daya Terpasang',
                    msgTarget: 'title',
                    allowBlank: true,
                    validateBlank: false
                },
                {
                    xtype: 'textfield',
                    cls: 'black',
                    id: 'dayaterpasangpln',
                    name: 'PLN_DAYA_JUMLAH',
                    margin: '10 10 5 5',
                    width: 130 / 1366 * screen.width,
                    msgTarget: 'title',
                    allowBlank: true,
                    validateBlank: false
                }]

        },
        {
            xtype: 'panel',
            layout: 'hbox',
            border: false,
            margin: '30 0 0 0',
            width: 690,
            items: [{
                    xtype: 'panel',
                    width: 100,
                    border: false,
                    height: 40

                },
                {
                    xtype: 'button',
                    text: 'Update',
                    id: 'btnUpdatePln',
                    margin: '0 10 0 0',
                    width: 60,
                    height: 30,
                    handler: function () {
                        InputDataPLN();
                    }
                },
                {
                    xtype: 'button',
                    text: 'Cancel',
                    id: 'btnCancelPln',
                    margin: '0 10 0 0',
                    width: 60,
                    height: 30,
                    handler: function () {
                        Ext.getCmp('formAssetPLN').getForm().setValues(data);
                    }
                },
                {
                    xtype: 'button',
                    text: 'EXPORT TO PDF',
                    icon : 'images/pdf-icon-btn.png',
                    margin: '0 0 0 50',
                    width: 105,
                    height: 30,
                    handler: function () {
            			location.href = pdf+""+site_id;
                    }
                },
                {
                    xtype: 'button',
                    text: 'EXPORT TO EXCEL',
                    icon : 'images/Excel-icon-btn.png',
                    margin: '0 0 0 10',
                    width: 105,
                    height: 30,
                    handler: function () {
                		location.href = xls+""+site_id;
                    }
                }
                ]

        }]

});